package com.cloudcc.mobile.util;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;

import com.cloudcc.mobile.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;

public class DisplayerHelper {

	public static DisplayImageOptions getNorImage() {
		DisplayImageOptions displayOptions = new DisplayImageOptions.Builder()
				.cacheInMemory(true).cacheOnDisc(true)
				.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
				.showImageOnFail(R.drawable.ease_default_avatar)
				.showImageOnLoading(R.drawable.ease_default_avatar).build();
		return displayOptions;
	}

	public static DisplayImageOptions getNorImage(Drawable defaultDrawable) {
		DisplayImageOptions displayOptions = new DisplayImageOptions.Builder()
				.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
				.showImageOnFail(defaultDrawable)
				.showImageForEmptyUri(defaultDrawable)
				.showImageOnLoading(defaultDrawable)
				.resetViewBeforeLoading(false)
				.bitmapConfig(Bitmap.Config.RGB_565).delayBeforeLoading(1000)
				.cacheInMemory(true).imageScaleType(ImageScaleType.EXACTLY)// default
				.cacheOnDisc(true).build();
		return displayOptions;
	}
}
